﻿using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
// --- Copyright (c) notice NevoWeb ---
//  Copyright (c) 2008 SARL NevoWeb.  www.nevoweb.com. BSD License.
// Author: D.C.Lee
// ------------------------------------------------------------------------
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// ------------------------------------------------------------------------
// This copyright notice may NOT be removed, obscured or modified without written consent from the author.
// --- End copyright notice --- 



using System.Runtime.Remoting;
using NEvoWeb.Modules.NB_Store.SharedFunctions;

namespace NEvoWeb.Modules.NB_Store
{


    public abstract class InternalUpdateInterface
    {

        #region "Shared/Static Methods"

        // singleton reference to the instantiated object 

        private static InternalUpdateInterface objProvider = null;
        // constructor
        static InternalUpdateInterface()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            ObjectHandle handle = null;
            string[] Prov = null;
            string ProviderName = null;

            ProviderName = GetStoreSetting(((DotNetNuke.Entities.Portals.PortalSettings)HttpContext.Current.Items("PortalSettings")).PortalId, "InternalUpdate.provider");
            if (!string.IsNullOrEmpty(ProviderName))
            {
                Prov = Strings.Split(ProviderName, ",");
                handle = Activator.CreateInstance(Prov[0], Prov[1]);
                objProvider = (InternalUpdateInterface)handle.Unwrap();
            }
        }

        // return the provider
        public static new InternalUpdateInterface Instance()
        {
            return objProvider;
        }

        #endregion

        public abstract void BankRemotePost(int PortalID, NB_Store_CartInfo cart, string Lang, System.Web.HttpRequest Request);

        public abstract void AutoResponse(int PortalID, NB_Store_CartInfo cart, System.Web.HttpRequest Request);

        public abstract string ReturnToStore(int PortalID, NB_Store_CartInfo cart, string Lang, System.Web.HttpRequest Request);


    }

}